# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=geary
pkgver=40.0
pkgrel=7
pkgdesc="Geary is an email application built around conversations"
url="https://wiki.gnome.org/Apps/Geary"
# s390x and riscv64 blocked by rust -> libhandy1
arch="all !s390x !riscv64"
license="LGPL-2.1-or-later AND CC-BY-3.0 AND BSD-2-Clause"
depends="iso-codes dbus:org.freedesktop.Secrets"
makedepends="
	appstream-glib-dev
	enchant2-dev
	folks-dev
	gcr-dev
	glib-dev
	gmime-dev
	gnome-online-accounts-dev
	gsound-dev
	gspell-dev
	gtk+3.0-dev
	iso-codes-dev
	itstool
	json-glib-dev
	libcanberra-dev
	libucontext-dev
	libgee-dev
	libhandy1-dev
	libnotify-dev
	libpeas-dev
	libsecret-dev
	libstemmer-dev
	libunwind-dev
	libxml2-dev
	meson
	sqlite-dev
	vala
	webkit2gtk-dev
	ytnef-dev
	"
checkdepends="xvfb-run desktop-file-utils ibus"
options="!check" # https://gitlab.gnome.org/GNOME/geary/-/issues/776
subpackages="$pkgname-lang $pkgname-doc"
source="https://download.gnome.org/sources/geary/${pkgver%.*}/geary-$pkgver.tar.xz
	vala-0.56.patch
	"

# secfixes:
#   3.37.91-r0:
#     - CVE-2020-24661

build() {
	LDFLAGS="$LDFLAGS -lucontext" abuild-meson \
		-Dlibunwind=auto \
		-Dprofile=release \
		. output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

check() {
	xvfb-run meson test --no-rebuild -v -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
d31716121be63a9d39caf4bffacce0109cebcc8048127c37fac6969b4103ab2cf12aac9bed73623b0f3baf7f39996b8f0b0fe9b57968054d51ae3e209f6b1522  geary-40.0.tar.xz
520a0038748eefabc767a4904bf428fda8b75fc2ae2e288ad8864b18231f07ea46e436a82e461b4b35cc438576036d7bbab3b2fb20bbe4ff4d99cb9ca7c2e83b  vala-0.56.patch
"
